<template>
  <div>
    {{ newData }}
    <button @click="changeData">修改数据</button>
  </div>
</template>

<script>
  export default {
    methods: {
      changeData() {
        this.newData = "哈哈哈"
      }
    },
    computed: {
      newData: {
        get() {
          // 监听的是谁
          return this.data;
        },
        set(value) {
          this.data = value
        }
      }
    },
    data() {
      return {
        data: "我是自有数据"
      }
    }
  }
</script>